'''
Created on 2015年12月14日

@author: SunXiaohui
'''
import File
import Config
import Algorithm

train = File.readFile(Config.BASE)
test = File.readFile(Config.TEST)
similarityMatrix = Algorithm.genSimilarityMatrix(train)  # 先根据训练集算出相似度矩阵
matrix = Algorithm.computeSimilarity(train, similarityMatrix) # 再计算出相似度
RSEMresult = Algorithm.computeRSME(matrix, test) # 预测集
RSEMaverage,tmpSum = 0
for x in range(RSEMresult.length):
    tmpSum += RSEMresult[x]
RSEMaverage = RSEMaverage / Config.TESTROWCOUNT
# 显示结果
print('大数据挖掘作业 --->协同过滤推荐系统/n')
print('作者：孙晓卉/n')
print('预测值：/n' + RSEMaverage)
print('/n预测值序列：/n' + RSEMresult)
    
    
    
    